package com.fzkj.shejimoshi.chain.wangzhe;

/**
 * @DESCRIPTION 60 抽一次
 */
public class Diamond60 implements Handler {
    private Handler handler; // 责任链下一个

    private static final Integer PRIZE = 60;
    // 奖池
    private static final String[] doc = {"白起", "夏侯惇", "甄姬", "金币288","小喇叭5","铭文碎片1600", "铭文碎片400","铭文碎片100", "铭文碎片25", "爱心气球（3日）", "亲密玫瑰","钻石48","龙域领主体验卡"};
    @Override
    public void handRequest(int number) {
        if (PRIZE.compareTo(number) == 0){
            int index = (int)(Math.random() * doc.length);
            String ret = doc[index];
            System.out.println(ret);
        }else {
            // 交给下一个处理
            System.out.println("60 交给下一个处理");
            handler.handRequest(number);
        }
    }

    @Override
    public void setNextChain(Handler handler) {
        this.handler = handler;
    }
}
